// https://nuxt.com/docs/api/configuration/nuxt-config
import axios from 'axios'

// @ts-nocheck

export default defineNuxtConfig({
  ssr: true,
  // nitro: {
  //   preset: 'static',
  // },
  // prerender: {
  //   crawlLinks: false,
  //   routes: async () => {
  //     try {
  //       const { data } = await axios.get('http://localhost:3002/api/news', {
  //         params: { page: 1, pageSize: 1000 }
  //       })
  //       const newsList = data?.data?.list || []
  //       return [
  //         '/news',
  //         ...newsList.map((item: any) => `/news/${item.id}`)
  //       ]
  //     } catch (e) {
  //       return ['/news']
  //     }
  //   },
  //   ignore: ['/login']
  // },
  devtools: { enabled: false },
  components: {
    global: true,
    dirs: ["~/components"],
  },
  modules: [
    "@nuxtjs/tailwindcss",
    "@element-plus/nuxt",
    "@pinia/nuxt",
    "@pinia-plugin-persistedstate/nuxt",
    "@nuxtjs/device"
  ],
  device: {
    refreshOnResize: true,
  },
  elementPlus: {
    themes: ["dark"],
  },
  imports: {
    dirs: ["./stores"],
  },
  app: {
    head: {
      link: [
        {
          rel: "stylesheet",
          href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css",
        },
      ],
    },
  },
});
